/**
 * tzdesk系统平台
 * moonvip_admin
 * com.tz.service.picture
 * IPictureService.java
 * 创建人:小胡 
 * 时间：2017年04月09日 13:46:24
 *
 */
package com.tz.service.picture.impl;

import com.tz.bean.Picture;
import com.tz.bean.TzParams;
import com.tz.dao.picture.IPictureMapper;
import com.tz.service.picture.IPictureService;
import com.tz.util.TmStringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * 图片管理serviceImpl
 * IPictureService
 * 创建人:小胡 
 * 时间：2017年04月09日 13:46:24
 * @version 1.0.0
 * 
 */
@Service
public class PictureServiceImpl implements IPictureService{

	@Autowired
	private IPictureMapper pictureMapper;
	
	@Override
	public List<Picture> findPictures(TzParams params){
		if(TmStringUtils.isEmpty(params.getOrder()))params.setOrder("create_time desc");
		return pictureMapper.findPictures(params);
	}
	
	@Override
	public int count(TzParams params) {
		return pictureMapper.count(params);
	}

	@Override
	public HashMap<String ,Object> getPicture(Integer id) {
		return pictureMapper.getPicture(id);
	}

	@Override
	public int save(Picture picture) {
		return pictureMapper.save(picture);
	}

	@Override
	public int update(Picture picture) {
		return pictureMapper.update(picture);
	}

	@Override
	public int delete(TzParams params) {
		return pictureMapper.delete(params);
	}
}
